// Length of list datapump.
// Copyright 2006 (C) Ralph Thomas

#include <datapumps/length.h>
#include <ui/array_datapump_adapter.h>
#include <util/concepts/list.h>

namespace datapumps {
	unsigned int get_length(const adobe::value_t& v) {
		return util::concept::get_list(v).size();
	}
	adobe::value_t make_length_datapump(const adobe::array_t& a, adobe::sheet_t& s) {
		return adobe::value_t( app::array_datapump_adapter_t<unsigned int (const adobe::value_t&)>::create( &get_length, s, a ) );
	}
}
